'use strict';

angular.module('CBO').controller('WorkLocationListController', ['$scope', 'PublicModule', 'PublicEnum', '$location', 'Authentication',
    function($scope, PublicModule, PublicEnum, $location, Authentication) {
    	PublicModule.initModule($scope, 'WorkLocation');
        $scope.Module.WorkLocation.LoadMode = PublicEnum.LoadMode.CacheAndPaging;
        $scope.Module.WorkLocation.PageSize = 15;
        $scope.Module.WorkLocation.Populate = {path: 'Department', select: 'Name'};

        $scope.btnAdd = function(){
        	$location.url('/index/WorkLocation/Edit');
        };

        $scope.rowDblClick = function(){
            $scope.$apply(function(){
                $location.url("/index/WorkLocation/Edit/" + $scope.Module.WorkLocation.FocusedRecord._id);
            });
        };

        $scope.btnDelete = function(){
        	$scope.Module.WorkLocation.deleteSelecteds();
        };
    }
]);